A well system (e.g., an oil or gas well) can include a wellbore that is typically drilled for extracting hydrocarbons from a subterranean formation. To determine information about the well system (e.g., such as the commercial viability of the well system), it may be desirable to analyze fluid in the wellbore. It may be challenging, however, to analyze fluid in the wellbore.